import sun.security.util.Password;

public class Login {
    public String userName="admin";

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return PassWord;
    }

    public void setPassWord(String passWord) {
        PassWord = passWord;
    }

    public String PassWord="123456";
    public static void loginInfo(String userName,String passWord)
            throws UserNameExceprtion,PasswordException{
        if(!userName.equals(userName)){
            throw new UserNameExceprtion("用户名错误");
        }
        if(!passWord.equals(passWord)){
            throw new PasswordException("用户名错误");
        }
        System.out.println("登陆成功");
    }
    public static void main(String[] args) {
        try{
            loginInfo("a3dmin","1236");
        }catch (UserNameExceprtion e){
            e.printStackTrace();
        }catch (PasswordException e){
            e.printStackTrace();
        }
    }
}
